<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单数据页面</title>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/themes/black/easyui.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/themes/color.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
var url;
/*添加订单信息*/
function newOrder() {
	/*显示添加订单信息的表单*/
	$('#dlg').dialog('open').dialog('center').dialog('setTitle', '输入订单');
	/*清空表单中的内容*/
	$('#fm').form('clear');
	
	url:'${pageContext.request.contextPath}/show/insert_insertOrderMsg.do';
}
function selectByTerm() {
	var senderName=$("#senderName").val();
	$('#order').datagrid({ 
	    url:'${pageContext.request.contextPath}/show/show_showMsg.do',
	    	  queryParams: {
	    		  senderName: senderName
	  		},
	    columns:[[    
			{field:'check',checkbox:true,width:100},    
			{field:'number',title:'订单编号',width:100},    
			{field:'startPlace',title:'收寄地',width:100},
			{field:'endPlace',title:'配送地',width:100},    
			{field:'senderName',title:'寄件人姓名',width:100},    
			{field:'sendTime',title:'收寄时间',width:100},
			{field:'receiverName',title:'收件人姓名',width:100},
			{field:'senderPhone',title:'寄件人电话',width:100},    
			{field:'status',title:'订单状态',width:100},    
	    ]]    
	});     
}
</script>
<body>
	<table id="order" title="订单信息" class="easyui-datagrid" 
		fit="true"
		url="${pageContext.request.contextPath}/show/show_showMsg.do"
		toolbar="#toolbar" 
		pagination="true" rownumbers="true" fitColumns="true">

		<thead>
			<tr>
				<th field="check" checkbox=true width="50px"></th>
				<th data-options="field:'number',width:100">订单编号</th>
				<th data-options="field:'startPlace',width:100">收寄地</th>
				<th data-options="field:'endPlace',width:100">配送地</th>
				<th data-options="field:'senderName',width:100">寄件人</th>
				<th data-options="field:'sendTime',width:100">收寄时间</th>
				<th data-options="field:'receiverName',width:100">收件人</th>
				<th data-options="field:'senderPhone',width:100">寄件人电话</th>
				<th data-options="field:'status',width:100">订单状态</th>
			</tr>
		</div>
		</thead>
	</table>
	<div id="toolbar">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-add" plain="true" onclick="newOrder()">输入订单</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-edit" plain="true" onclick="editOrder()">修改订单</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-remove" plain="true" onclick="destroyUser()">删除订单</a>
			寄件人姓名:<input type="text" id="senderName" class="easyui-textbox"/>
			<a
			href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-search" plain="true" onclick="selectByTerm()">查询</a>
	</div>
	
	<div id="dlg" class="easyui-dialog"
		style="width: 100%; height:100%; padding: 10px 20px" closed="true"
		buttons="#dlg-buttons" data-options="modal:true">
		<table border=1>
		<form id="fm" method="post">
			<div class="fitem">   
        		<label for="number">订单编号:</label>   
       			 <input class="easyui-textbox" type="text" name="number" id="number" data-options="required:true"/>   
    		</div>   
    		<div class="fitem">   
        		<label for="startPlace">收&nbsp;寄&nbsp;地:</label>   
        		<select id="startPlace" class="easyui-combobox" name="startPlace" style="width:150px;"   
        			data-options="    
            			 idField:'code',    
            			textField:'text'
            			">
            			</select>   
			</div>   
     		<div class="fitem">   
        		<label for="sendTime">收寄日期:</label>   
      			<input id="dd" type="text" class="easyui-datebox" required="required"></input> 

			</div>  
			<div class="fitem">   
        		<label for="endPlace">配&nbsp;送&nbsp;地:</label>   
        		 <select id="endPlace" class="easyui-combobox" name="endPlace" style="width:150px;"   
        			data-options="    
            			idField:'code',    
            			textField:'text'">
            	</select> 
			</div>
			<div class="fitem">   
       			 <label for="orderType">订单类别:</label>   
        		 <select id="orderType" class="easyui-combobox" name="orderType" style="width:150px;"   
        			data-options="    
            			valueField:'id',
            			textField:'name'">
        		</select> 
			</div> 
			<div class="fitem">
				<label>寄件人资料</label>
				<div class="fitem">
					<label>姓名:</label>
					<input id="senderName" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>电话:</label>
					<input id="senderPhone" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>地址:</label>
					<input id="senderAdress" type="text" class="easyui-textbox" required="required">
				</div>
			</div>  
			<div class="fitem">
				<label>货物资料</label>
				<div class="fitem">
					<label>重量:</label>
					<input id="receiverName" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>体积:</label>
					<input id="receiverPhone" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>货物名称:</label>
					<input id="goods" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>数量:</label>
					<input id="count" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>货物类别:</label>
					 <select id="goodType" class="easyui-combobox" name="goodType" editable=false
					  style="width:150px;"   
        			  data-options="    
            			valueField:'id',
            			textField:'name'">
            		</select> 
				</div>
			</div> 
			<div class="fitem">
				<label>资费情况</label>
				<div class="fitem">
					<label>资费:</label>
					<input id="senderName" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>总计费用:</label>
					<input id="senderPhone" type="text" class="easyui-textbox" required="required">
				</div>
				<div class="fitem">
					<label>支付方式:</label>
						<input type="radio" name="payWay" value=1>寄件人
　　						<input type="radio" name="payWay" value=2>收件人
				</div>
			</div>  
			<div class="fitem">
				<label>发货日期:</label>
					<input id="sendData" type="text" class="easyui-datebox" required="required"></input> 
			</div>
		</form>
		</table>
	</div>
	<div id="dlg-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton c6"
			iconCls="icon-ok" onclick="saveUser()" style="width: 90px">确定</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')"
			style="width: 90px">取消</a>
	</div>
</body>
</html>